Passed
Pull Request — master (#22)
by
unknown
08:10 queued 04:20
created

SignItemComponent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A remListItem 0 3 1
A ngOnInit 0 2 1
1
import { ValueAccessorBase } from './../abstract/ValueAccessorBase';
2
/**
3
   Copyright 2018 June Hanabi
4
5
   Licensed under the Apache License, Version 2.0 (the "License");
6
   you may not use this file except in compliance with the License.
7
   You may obtain a copy of the License at
8
9
       http://www.apache.org/licenses/LICENSE-2.0
10
11
   Unless required by applicable law or agreed to in writing, software
12
   distributed under the License is distributed on an "AS IS" BASIS,
13
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
   See the License for the specific language governing permissions and
15
   limitations under the License.
16
 */
17
18
import { Component, EventEmitter, Output, Input, OnInit } from '@angular/core';
19
20
import {
21
    NG_VALUE_ACCESSOR,
22
} from '@angular/forms';
23
24
@Component({
25
    selector: 'sign-item',
26
    templateUrl: './sign-item.component.pug',
27
    styleUrls: ['./sign-item.component.scss'],
28
    providers: [
29
        { provide: NG_VALUE_ACCESSOR, useExisting: SignItemComponent, multi: true }
30
    ],
31
})
32
export class SignItemComponent extends ValueAccessorBase<string> implements OnInit {
33
34
    constructor() {
35
        super();
36
    }
37
38
    ngOnInit() {
39
40
    }
41
42
    @Input()
43
    public disabled: boolean = false;
44
45
    @Input()
46
    public data: any = { x: 0, y: 0, text: 0 };
47
48
    @Output()
49
    public remove: EventEmitter<boolean> = new EventEmitter();
50
51
    remListItem() {
52
        this.remove.emit(true);
53
    }
54
}
55